import { menuConfigMap } from './menuConfigMap';
import {
  menuConfigFullProps,
  menuConfigProps,
  menuConfigTopProps,
} from './interface';

export const menuConfigFull: menuConfigFullProps[] = [
  {
    id: 'home',
    title: '主页',
    component: menuConfigMap.Home,
  },
];

export const menuConfig: menuConfigProps = {
  test_home_page: [
    {
      id: 'sub1',
      name: 'AntV-G2Pplot',
      severalLevels: '1',
      icon: 'icon-antdv',
      children: [
        {
          name: '练习',
          authority: ['admin'],
          severalLevels: '2',
          path: [
            {
              path: 'test_home_page/G2Plot',
              exact: true,
              component: menuConfigMap.G2Plot,
            },
          ],
        },
      ],
    },
    {
      id: 'sub2',
      name: '拖拽',
      severalLevels: '1',
      icon: 'icon-tuodong',
      children: [
        {
          name: 'react-beautiful-dnd',
          authority: ['admin'],
          severalLevels: '2',
          path: [
            {
              path: 'test_home_page/beautiful-dnd',
              exact: true,
              component: menuConfigMap.BeautifulDnd,
            },
          ],
        },
        {
          name: 'ReactDraggable',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/ReactDraggable',
          component: menuConfigMap.ReactDraggable,
        },
        {
          name: 'react-sortable-hoc',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/react-sortable-hoc',
          component: menuConfigMap.ReactSortableHoc,
        },
        {
          name: 'ReactSortablejs',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/ReactSortablejs',
          component: menuConfigMap.ReactSortablejs,
        },
        {
          name: 'ReactSmoothDnd',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/ReactSmoothDnd',
          component: menuConfigMap.ReactSmoothDnd,
        },
      ],
    },
    {
      id: 'sub3',
      name: 'Arco Design',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'Arco Design 练习',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/arco-design',
          component: menuConfigMap.ArcoDesign,
        },
      ],
    },
    {
      id: 'sub4',
      name: 'AntV-X6',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: '练习',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/antv-x6-practice',
          component: menuConfigMap.AntV_X6_practice,
        },
        {
          name: '拖拽',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/antv-x6-dnd',
          component: menuConfigMap.AntV_X6_Dnd,
        },
        {
          name: '资产管理',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/ResourceTopology',
          component: menuConfigMap.ResourceTopology,
        },
      ],
    },
    {
      id: 'sub5',
      name: '流程图',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'react-flow-renderer',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/react-flow-renderer',
          component: menuConfigMap.ReactFlowRenderer,
        },
        {
          name: 'D3',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/D3',
          component: menuConfigMap.D3_demo,
        },
        {
          name: 'Fabric.js(有问题,组件销毁后直接报错)',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/FabricDemo',
          component: menuConfigMap.FabricDemo,
        },
        {
          name: 'GGEditor',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/GGEditor',
          component: menuConfigMap.GGEditor,
        },
      ],
    },
    {
      id: 'sub6',
      name: 'MOCK',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'demo_mockjs',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/demo_mockjs',
          component: menuConfigMap.Demo_mockjs,
        },
      ],
    },
    {
      id: 'sub7',
      name: 'Echarts',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'Echarts',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/Echarts',
          component: menuConfigMap.Echarts,
        },
      ],
    },
    {
      id: 'sub9',
      name: '下拉滚动DEMO',
      severalLevels: '1',
      icon: '',
      path: 'test_home_page/RollingLoad',
      component: menuConfigMap.RollingLoad,
    },
    {
      id: 'sub10',
      name: '富文本编辑器',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'Draft',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/Draft',
          component: menuConfigMap.Draft,
        },
        {
          name: 'AoMaoEditor',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/AoMaoEditor',
          component: menuConfigMap.AoMaoEditor,
        },
        {
          name: 'Vditor',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/Vditor',
          component: menuConfigMap.Vditor,
        },
        {
          name: 'WangEditor',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/WangEditor',
          component: menuConfigMap.WangEditor,
        },
      ],
    },
    {
      id: 'sub11',
      name: 'Table 可伸缩列',
      severalLevels: '1',
      icon: '',
      path: 'test_home_page/Resizable',
      component: menuConfigMap.Resizable,
    },
    {
      id: 'sub12',
      name: 'AntV-g2',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: '练习',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/antv-g2',
          component: menuConfigMap.AntvG2Demo,
        },
      ],
    },

    {
      id: 'sub13',
      name: '地图',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: '高德地图',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/Map',
          component: menuConfigMap.Map,
        },
        {
          name: 'EchartsMap',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/EchartsMap',
          component: menuConfigMap.EchartsMap,
        },
      ],
    },
    {
      id: 'sub14',
      name: '日历',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'Fullcalendar',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/Fullcalendar',
          component: menuConfigMap.Fullcalendar,
        },
      ],
    },
    {
      id: 'sub15',
      name: 'TreeGraph',
      severalLevels: '1',
      icon: '',
      children: [
        {
          name: 'Tree-Graph-React',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_home_page/Tree-Graph-React',
          component: menuConfigMap.TreeGraph,
        },
      ],
    },
    {
      id: 'sub16',
      name: 'RRWeb',
      severalLevels: '1',
      icon: '',
      path: 'test_home_page/RRWeb',
      component: menuConfigMap.RRWeb,
    },
  ],
  test_study: [
    {
      id: 'sub1',
      name: 'Form',
      severalLevels: '1',
      children: [
        {
          name: 'Form_shouldUpdate',
          authority: ['admin'],
          severalLevels: '2',
          path: [
            {
              path: 'test_study/Form_shouldUpdate',
              exact: true,
              component: menuConfigMap.Form_shouldUpdate,
            },
          ],
        },
        {
          name: '手写一个Form表单',
          authority: ['admin'],
          severalLevels: '2',
          path: [
            {
              path: 'test_study/CustomForm',
              exact: true,
              component: menuConfigMap.CustomForm,
            },
          ],
        },
      ],
    },
    {
      id: 'sub2',
      name: '组件',
      severalLevels: '1',
      children: [
        {
          name: '函数组件',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/Fn',
          component: menuConfigMap.Fn,
        },
        {
          name: '类组件',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/Class',
          component: menuConfigMap.Class,
        },
        {
          name: 'Select_Demo',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/Select_Demo',
          component: menuConfigMap.CustomSelectDemo,
        },
        {
          name: '瀑布图组件',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/Waterfall',
          component: menuConfigMap.Waterfall,
        },
      ],
    },
    {
      id: 'sub3',
      name: 'Ant Design',
      severalLevels: '1',
      children: [
        {
          name: 'ModalRender',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/Modal',
          component: menuConfigMap.ModalRender,
        },
        {
          name: 'TreeSelect',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/TreeSelect',
          component: menuConfigMap.TreeSelect,
        },
        {
          name: 'Tree',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/Tree',
          component: menuConfigMap.DemoTree,
        },
      ],
    },
    {
      id: 'sub4',
      name: '其他',
      severalLevels: '1',
      children: [
        {
          name: '歌词滚动',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/LyricDemo',
          component: menuConfigMap.LyricDemo,
        },
        {
          name: 'React Map Demo',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/ReactMapDemo',
          component: menuConfigMap.ReactMapDemo,
        },
        {
          name: '自定义Loading',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/CustomLoading',
          component: menuConfigMap.CustomLoading,
        },
        {
          name: 'Demo',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/CustomDemo',
          component: menuConfigMap.CustomDemo,
        },
        {
          name: 'Markdown 生成 锚点',
          authority: ['admin'],
          severalLevels: '2',
          path: 'test_study/MarkdownTOC',
          component: menuConfigMap.MarkdownTOC,
        },
      ],
    },
  ],
};

export const menuConfigTop: menuConfigTopProps[] = [
  {
    id: 'test_home_page',
    name: 'Library',
    icon: 'icon-disanfangku',
    path: 'test_home_page/G2Plot',
    openKeys: 'sub1',
  },
  {
    id: 'test_study',
    name: 'Study',
    icon: 'icon-disanfangku',
    path: 'test_study/Form_shouldUpdate',
    openKeys: 'sub1',
  },
];
